#include "myLed.h"

Led::Led(){
  Serial.println("Led Object Created.");
  pinMode(ledPin, OUTPUT);
}

Led::Led(int userLedPin){
  Serial.println("Led Object Created.");
  ledPin = userLedPin;
  pinMode(ledPin, OUTPUT);
}

Led::~Led(){
  Serial.println("Led Object Deleted.");
}

void Led::on(){
  digitalWrite(ledPin, HIGH);
}

void Led::off(){
  digitalWrite(ledPin, LOW);
}


int Led::getLedPin(){
  return ledPin;
}

void Led::setLedPin(int userLedPin){
  ledPin = userLedPin;
  pinMode(ledPin, OUTPUT);
}

void PwmLed::on(int userPwmVal){
  pwmVal = userPwmVal;
  analogWrite(getLedPin(), pwmVal);
}

int PwmLed::getPwmVal(){
  return pwmVal;
}
